﻿namespace Stationierung
{
    using System;
    using System.Collections;
    using System.Windows.Input;

    using Stationierung.Model;

    public class ResetStationCommandHandle : ICommand
    {
        public bool CanExecute(object parameter)
        {
            return parameter is ICollection && (parameter as ICollection).Count > 0;
        }


        public event EventHandler CanExecuteChanged
        {
            add { CommandManager.RequerySuggested += value; }
            remove { CommandManager.RequerySuggested -= value; }
        }

        public void Execute(object parameter)
        {
            if (parameter is ICollection)
            {
                App.MainViewModel.ResetStations();
            }
        }
    }
}
